﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace produccion.clases
{
    public class CLSPRCESP : ObservableObject
    {
        MDOgeneral mod = new MDOgeneral();
        #region Propiedades
        private string _CODPRC_PES;
        public string CODPRC_PES
        {
            get { return _CODPRC_PES; }
            set { _CODPRC_PES = value; base.OnPropertyChanged("CODPRC_PES"); }
        }
        private string _NOMPRC_PES;
        public string NOMPRC_PES
        {
            get { return _NOMPRC_PES; }
            set { _NOMPRC_PES = value; base.OnPropertyChanged("NOMPRC_PES"); }
        }
        #endregion
        #region Metodos
        public List<CLSPRCESP> listarProcesosEspeciales()
        {
            try
            {
                string query = "select CODPRC_PES, NOMPRC_PES  from PRCESP order by NOMPRC_PES ";
                DataTable dt = mod.consulta(query);
                List<CLSPRCESP> lista = new List<CLSPRCESP>();

                foreach (DataRow r in dt.Rows)
                {
                    lista.Add(new CLSPRCESP
                    {
                        CODPRC_PES = r["CODPRC_PES"].ToString(),
                        NOMPRC_PES = r["NOMPRC_PES"].ToString(),
                    });
                }

                return lista;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion
    }
}
